/* ******************************************************************
 * This file is part of the escal project and distributed under the
 * terms of the GNU General Public License Version 3
 * Copyright (C) 2008 Epocher (xijiaosdq@gmail.com)
 * See COPYING file for licensing information.
 *******************************************************************/

#ifndef FOLDER_LIST_MODEL_H
#define FOLDER_LIST_MODEL_H

#include <QAbstractItemModel>
#include <QStringList>

class QFileDialog;

class FolderListModel : public QAbstractItemModel{
	Q_OBJECT
public:
	FolderListModel(QObject *parent=0);
	int columnCount(const QModelIndex &parent=QModelIndex()) const;
	int rowCount(const QModelIndex &parent=QModelIndex()) const;
	QVariant data(const QModelIndex &index, int role) const;
	Qt::ItemFlags flags(const QModelIndex &index) const;
	QVariant headerData(int column, Qt::Orientation orientation, 
		int role) const;
	QModelIndex index(int row, int column, const QModelIndex 
			&parent=QModelIndex() ) const;
	QModelIndex parent(const QModelIndex &index) const;
	void deleteFolder(const QModelIndex &index);
	void moveUpFolder(const QModelIndex &index);
	void moveDownFolder(const QModelIndex &index);
	void moveToTopFolder(const QModelIndex &index);
	void moveToBottomFolder(const QModelIndex &index);
public slots:
	void foldersChanged();
	void newFolder();
protected:
	void syncFolderList();
private:
	QFileDialog *dirDialog;
	QStringList folderList;
	QStringList columnHeaders;
};

#endif /* FOLDER_LIST_MODEL_H */
